<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浮动练习-京东多列布局(Floating Exercise - JD Multi Column Layout)</title>
  <style>
    .container {
      width: 1190px;
      height: 700px;
      background-color: skyblue;
    }

    .container .last-child,
    .container .nth-child {
      width: 230px;
      height: 322px;
      background: purple;
    }

    /* 方案1 */
    .container .last-child {
      float: left;
      margin-right: 10px;
    }

    .container .last-child:last-child {
      margin-right: 0;
    }

    /* 方案二 */
    .container .nth-child {
      float: left;
      margin-right: 10px;
    }

    .container .nth-child:nth-child(5n) {
      margin-right: 0;
    }

    /* 方案三 */
    .container .box {
      margin-left: -10px;
      /* margin: 0 -5px; */
    }

    .container .item {
      width: 230px;
      height: 322px;
      background: purple;
      float: left;
      margin-left: 10px;
      /* margin: 0 5px; */
    }
  </style>
</head>

<body>

  <h3>方案1</h3>
  <div class="container">
    <div class="last-child">1</div>
    <div class="last-child">2</div>
    <div class="last-child">3</div>
    <div class="last-child">4</div>
    <div class="last-child">5</div>
  </div>

  <h3>方案2</h3>
  <div class="container">
    <div class="nth-child">1</div>
    <div class="nth-child">2</div>
    <div class="nth-child">3</div>
    <div class="nth-child">4</div>
    <div class="nth-child">5</div>
  </div>

  <h3>方案3</h3>
  <div class="container">
    <div class="box">
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      <div class="item">4</div>
      <div class="item">5</div>
    </div>
  </div>

</body>

</html>